#include<stdio.h>
#include<stdlib.h>
#define N 13
static int K=5;
int arr[N] = {3,13,1,16,4,10,5,2,11,9,8,12,7,15};

int bigger_num(int mid){
    int num = 0,i;
    for(i=0;i<N;i++)
        if(arr[i]>mid)
            num++;
    return num;
}

int extreme(int tag){
    int i,max,min;
    max = 0;
    min = 999999;
    if(tag==0){
        for(i=0;i<N;i++){
            if(arr[i]>max)
                max = arr[i];
        }
        return max;
    }else{
        for(i=0;i<N;i++){
            if(arr[i]<min)
                min = arr[i];
        }
        return min;
    }
}

int main(){
    int delta = 1,max,min,mid,num;
    max = extreme(0);
    min = extreme(1);
    while(max>min){
        mid = min + (max-min)*0.5;
        num = bigger_num(mid);
        if(num > K-1)
            min = mid;
        else if(num < K-1)
            max = mid;
        else
            break;
    }
    printf("%d\n",mid);

    return 0;
}
